import Vue from 'vue'
import Vuex from 'vuex'
import modules from './modules'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    config: {},
    token: '', // 登录凭证
    isCollapse: false // 菜单是否折叠
  },
  mutations: {
    SET_COLLAPSE (state) {
      state.isCollapse = !state.isCollapse
    }
  },
  actions: {
    setCollapse ({ commit }) {
      commit('SET_COLLAPSE')
    }
  },
  modules
})
